package com.jDesin;

import com.jDesin.Template.message.SendMsg;
import com.jDesin.Template.notice.NoticeService;
import com.jDesin.Template.service.BaseService;
import com.jDesin.abstr.RefreshBaverage;
import com.jDesin.impl.Milk;
import com.jDesin.impl.Tea;
import com.jDesin.thread.Thread1;
import com.jDesin.thread.Thread2;

/***
 * 执行主类
 * @author Administrator
 *
 */
public class ExecuMain {
	
	/***
	 * 执行主类
	 * @param args
	 */
	public static void main(String[] args) {
		
		//泡牛奶
		 RefreshBaverage milk=new Milk();
	     milk.prepreBvergeTemplage();
		
		//泡茶
		RefreshBaverage tea=new Tea();
		tea.prepreBvergeTemplage();
		
		//执行线程1
		Thread1 th1=new Thread1();
		th1.start();
		
		//执行线程2
		Thread2 th=new Thread2();
		th.start();
		
		//重写子类方法
		SendMsg smsg=new SendMsg(new BaseService() {
			@Override
			public void saveData() {
				System.out.println("保存消息至数据库成功!");
			}
		});
		//调用发送消息方法
		smsg.SendMessge();
	    //发送消息通知
		NoticeService  nservice=new NoticeService();
	  	nservice.SendMessge();
	}

}
